﻿<!--{inc(header.view.html)}-->

<div class="content" id="content">
	<div class="top-menu-box">
    	<div class="z">
            <span class="z-f"><a href="#">用户数据</a>&nbsp;&gt;</span>
            <span class="z-f"><a href="#">用户列表</a></span>
            <div class="z-f-r"><span class="user-t"><a href="{$site_url}"  target="_blank">网站首页</a></span><span class="user-info"></span><a href="index.php?app=default&act=quit" onClick="return confirm('确认退出管理系统吗？');"   >退出管理</a></div>
        </div>
        <div class="top-menu">
        	<ul>
            	<li class="current"><a href="#">用户列表</a></li>
				<li><a href="index.php?app=user&act=add" target="mainframe">添加用户</a></li>			
				
				
            </ul>
            <div class="clear"></div>
        </div>
    </div>
    
    <div class="main">

<style type="text/css">
.search_box {
padding:10px;
vertical-align:middle;
}
.search_box .l {
float:left;
vertical-align:middle;
}
.search_box .r {
float:right;
}
</style>
                                   
<script language="javascript" type="text/javascript">

function ato_roleid_url(url,obj){
	document.location.href = url+"&roleid="+obj.value;
}
function ato_usertype_url(url,obj){
	document.location.href = url+"&usertype="+obj.value;
}
function ato_condition_url(url,obj){
	document.location.href = url+"&condition="+obj.value;
}
</script>                                    
                              
<form  method="post" action="?app=user&act=index&v={$v}&roleid={$roleid}&usertype={$usertype}&condition={$condition}" >

<div class="search_box">
<div class="l"><img  src="{$web_view_dir}style/images/it_nav.gif" align="middle">
排序方式: 
<select  onchange="ato_url('index.php?app=user&act=index&roleid={$roleid}&usertype={$usertype}&condition={$condition}&word={$word}&fieldtype={$fieldtype}',this);" >
<option class="txtgreen" value="0">请选择...</option>
<option value="timeasc" <?php if ($v=='timeasc') { ?>selected="selected" <?php } ?> >时间升序↑</option>
<option value="timedesc" <?php if ($v=='timedesc') { ?>selected="selected" <?php } ?> >时间降序↓</option>
<option value="islocked" <?php if ($v=='islocked') { ?>selected="selected" <?php } ?> >锁定的用户</option>
</select>
<br/><br/>
用户组查看: 
<select  onchange="ato_roleid_url('index.php?app=user&act=index&v={$v}&usertype={$usertype}&condition={$condition}&word={$word}&fieldtype={$fieldtype}',this);" >
<option  class="txtgreen" value="0" selected="selected">全部用户</option>

 <?php foreach((array)$roledata as $_key => $_value ) { ?>
                                           
		<option value="{$_value.value}"   <?php if ($roleid==$_value.value) { ?>selected="selected" <?php } ?>  >{$_value.name}</option>
                
 <?php } ?>

</select>
&nbsp;
用户类型: 
<select  onchange="ato_usertype_url('index.php?app=user&act=index&v={$v}&roleid={$roleid}&condition={$condition}&word={$word}&fieldtype={$fieldtype}',this);" >
		<option value="0"  >请选择用户类型....</option>
	
<?php foreach((array)$usertypedata as $_key => $_value ) { ?>
                                           
		<option value="{$_key}"  <?php if ($usertype==$_key) { ?>selected="selected" <?php } ?>   >{$_value.name}</option>
                
<?php } ?>
</select>
&nbsp;
条件选择: 
<select  onchange="ato_condition_url('index.php?app=user&act=index&v={$v}&roleid={$roleid}&usertype={$usertype}&word={$word}&fieldtype={$fieldtype}',this);" >
<option value="lockedno" <?php if ($condition=='lockedno') { ?>selected="selected" <?php } ?> >未锁定用户</option>
<option value="lockedyes" <?php if ($condition=='lockedyes') { ?>selected="selected" <?php } ?> >锁定的用户</option>
<option value="duetimeno" <?php if ($condition=='duetimeno') { ?>selected="selected" <?php } ?> >未到期用户</option>
<option value="duetimeyes" <?php if ($condition=='duetimeyes') { ?>selected="selected" <?php } ?> >到期用户</option>                
</select>
&nbsp;&nbsp;按
<select  name="fieldtype" >
<option value="user_name" <?php if ($fieldtype=='user_name') { ?>selected="selected" <?php } ?> >用户名</option>
<option value="user_email" <?php if ($fieldtype=='user_email') { ?>selected="selected" <?php } ?> >E-mail</option>              
</select>
<input type="text" title="多个关键字用空格隔开" value="{$word}" name="word"> <input type="submit" value="搜索用户" class="buton">
<br/><br/>
</div>
<div class="r">

</div>
</div>
</form>
    <div class="clear"></div>	
	
	
<form method="post" name="user_form" action="?app=user&act=index&job=work" onsubmit="dosubmit(this)">	
    <table  class="data" >
        <thead>
		
	<th>用户名称</th>
	<th>E-Mail</th>
	<th>用户组</th>
	<th>用户积分</th>	
	<th>用户类型/默认对应用户组</th>	
	<th>注册时间/到期时间</th>  
	<th>权限设置</th>    
	<th >操作</th>
		  
		  
	
        </thead>
	    <tbody>
		
        
<?php foreach((array)$lw_data as $_key => $_value ) { ?>

<tr  >
	<td>
		<input type="checkbox"  value="{$_value.user_id}" id="userids" name="checkdata[]">
		<a href="?app=user&act=edit&id={$_value.user_id}">{$_value.user_name}</a></span>
	</td>
	<td align="center">{$_value.user_email}</td>
	<td align="center">{$rolename[$_value.role_id]}</td>
	<td align="center">{$_value.integral}</td>	
	<td align="center"><a href="?app=usercon&act=edit&tid={$_value.user_type}&id={$_value.user_id}">{$usertypedata[$_value.user_type][name]}</a>=>{$rolename[$usertypedata[$_value.user_type][roleid]]}</td>	
	<td align="center" class="txtgray" style="font-size:9px">{$_value.reg_time|dateymdgis}<br/><font color="#FF0000" style="font-size:10px; font-weight:bold">{$_value.due_time|dateymdgis}</font></td>

	<td align="center">
    	                                 <select name="data[power]"  onchange="ato_url('index.php?app=user&act=power&id={$_value.user_id}',this);">
 		                                       <option  value="">请选择...</option>                                        
                                          <?php foreach((array)$roleicon as $_key => $_value1 ) { ?>                                     
		                                       <option  value="{$_value1}">{$_value1}</option>                                       
		                                   <?php } ?>
	                                     </select>
    </td>
    
    
	<td align="center">
			<a href="?app=user&act=inipwd&id={$_value.user_id}">初始化密码</a>
        <br/>
		<a href="?app=user&act=locked&id={$_value.user_id}&s={$_value.locked}"><?php if ($_value.locked) { ?>启用<?php } else { ?>锁定<?php } ?></a>
        <br/>
	<a onClick="return confirm('确认删除？该用户的文件(夹)、提取码等将会全部被删除，请慎用！');" href="?app=user&act=del&id={$_value.user_id}">删除</a>
		</td>
</tr>

<?php } ?>	
        




<style type="text/css">

.p_bar {
margin-top:5px;
}
.p_info {
border:1px solid #CCCCCC;
margin:0 3px;
padding:3px 5px;
text-align:center;
}
.p_curpage {
border:1px solid #CCCCCC;
color:#FF0000;
font-weight:bold;
margin:0 2px;
padding:3px 5px;
text-align:center;
}

.p_num  {
border:1px solid #CCCCCC;
margin:0 3px;
padding:3px 5px;
text-align:center;
}
.p_redirect {
border:1px solid #CCCCCC;
margin:0 3px;
padding:3px 5px;
text-align:center;
}

a {
color:#003366;
text-decoration:none;
}


</style>

<tr>
	<td colspan="8">
    <div class="p_bar">
    <span class="p_info">Total:&nbsp;<b>{$lw_page.total}</b>&nbsp;&nbsp;共{$lw_page.curr.num}/{$lw_page.totalpage}页</span>
    <a class="p_num" href="{$lw_page.head}">首页</a>
    <a class="p_num" href="{$lw_page.up}">&lt;&lt;</a>
    <a class="p_num" href="{$lw_page.up}">上一页</a>
    <span class="p_curpage">{$lw_page.curr.num}</span>
    <a  class="p_num" href="{$lw_page.down}">下一页</a>
    <a  class="p_num" href="{$lw_page.down}">&gt;&gt;</a>
    <a  class="p_num" href="{$lw_page.foot}">末页</a>    
    
    </div>
    </td>
</tr>

<tr>
	<td class="td_line" colspan="8"><a onClick="reverse_ids();" href="javascript:void(0);">全选/反选</a>&nbsp;&nbsp;<a onClick="cancel_ids();" href="javascript:void(0);">取消选择</a>
		   <input type="hidden" name="jobs" value="0">
	   <input type="button" name="Submit3" value="批量删除" onClick="postdo('del')" class="buton">
        <input type="button" name="Submit2" value="初始化密码" onclick="postdo('inipwd')" class="buton">	   
        <input type="button" name="Submit2" value="锁定" onclick="postdobatch('locked:1')" class="buton">
        <input type="button" name="Submit2" value="取消锁定" onclick="postdobatch('locked:0')" class="buton">		
	<br/><br/>
	&nbsp;&nbsp;
	移动到: 
	<select name="moverole" id="moverole">
	<option class="txtgreen" value="0" selected="selected">请选择...</option>
  <?php foreach((array)$roledata as $_key => $_value ) { ?>
                                           
		<option value="{$_value.value}" >{$_value.name}</option>
                
  <?php } ?>
		</select>用户组<input type="submit"  value=" 提 交 " onclick="postdobatch('moverole')" class="buton">
	<br/><br/>
    &nbsp;&nbsp;
	移动到: 
	<select name="movetype" id="movetype">
	<option class="txtgreen" value="0" selected="selected">请选择...</option>
<?php foreach((array)$usertypedata as $_key => $_value ) { ?>
                                           
		<option value="{$_key}"  >{$_value.name}</option>
                
<?php } ?>
		</select>用户类型<input type="submit"  value=" 提 交 " onclick="postdobatch('movetype')" class="buton">
		
		
	</td>
</tr>	
		
	    </tbody>
    </table>
      </form>	

    <script language="javascript">
function postdo(va){
	document.user_form.action='?app=user&act='+va+'';
	document.user_form.jobs.value=va;
	document.user_form.submit();
}
function postdobatch(va){
	if(va=='moverole'||va=='movetype'){
		document.user_form.action='?app=user&act=batch&selcetid='+document.getElementById(va).value+'';
	}
	else
	{
	document.user_form.action='?app=user&act=batch';	
	}

	document.user_form.jobs.value=va;
	document.user_form.submit();
}	
	
function reverse_ids(){
	for (var i=0;i<document.user_form.userids.length;i++) {
		var ids = document.user_form.userids[i];
		ids.checked = !ids.checked;
	}
}
function cancel_ids(){
	for (var i=0;i<document.user_form.userids.length;i++) {
		var ids = document.user_form.userids[i];
		ids.checked = false;
	}
}
function checkbox(){
	n = document.getElementsByName("checkdata[]");
	var j =0;
	for(i = 0; i < n.length; i++){
		if(n[i].checked){
			j++;
		}
	}
	if(j ==0){
		alert("请选择要移动的用户");
		return false;
	}else{
		return true;
	}
}

function dosubmit(o){
	if(checkbox() != true){
		return false;
	}
/*	if(o.moverole.value ==0){
		alert("请选择目标用户组");
		o.moverole.focus();
		return false;
	}
	if(o.movetype.value ==0){
		alert("请选择目标用户类型");
		o.movetype.focus();
		return false;
	}	*/
}
</script> 	
        
        <div class="notic"><img  src="{$web_view_dir}style/images/light.gif" align="absmiddle" /> <b>提示: </b> <span ></span></div>
    </div>
</div>
<!--{inc(footer.view.html)}-->